class kmeans_regions
{
public:
  
  
  // class constructor  (there can be more than one, as long as each has a different number of arguments, or argument types)
  inline 		kmeans_regions(const std::string field_means, const int in_Ncent);
  
  inline void 	run(const uword N_iter);
  
  inline uvec	small_clusters(uword n_segm);
  inline uvec	near_points();
  
private:
  
  // variables that are not accessible outside of the kmeans class
  
  //     const mat& 	data;
  const uword 	N_cent;
  uword	Dim;
  uword	N_reg;
  uword	N_data;
  
  umat partitions;
  umat new_partitions;
  umat partitions2; // 
  
  field<mat> cent_segms;
  field<mat> cent_2;
  vec distances;
  uvec initial_indices;
  uvec indices2;
  
  uvec counts;
  uvec counts2;
  
  double err;
  uword best_ci;
  mat means;
  //mat covs;     // this does not have to be declared: it can be calculated inside get_covs()
  vec weights;
  double distortion; // Nov15,2013 
  mat Points_cent; // Nov15,2013 
  field<mat> Mean_segment; //Dic 10
  
  inline void 	ini_cent();
  inline void 	update_cent();
  inline void		init_partitions();
  
  
  
};
